home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / ColorSync 2.1.2 GM / Interfaces / CIncludes / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-18  |  26.6 KB  |  860 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    Definitions for ColorSync 2.0 profile
  5.  
  6.      Version:    ColorSync 2.1
  7.  
  8.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  9.                  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18.  
  19. #ifndef __CMICCPROFILE__
  20. #define __CMICCPROFILE__
  21.  
  22. #ifndef __TYPES__
  23. #include <Types.h>
  24. #endif
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #if PRAGMA_IMPORT_SUPPORTED
  31. #pragma import on
  32. #endif
  33.  
  34. #if PRAGMA_ALIGN_SUPPORTED
  35. #pragma options align=mac68k
  36. #endif
  37.  
  38. /* Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 */
  39.  
  40. enum {
  41.     cmCS2ProfileVersion            = 0x02000000
  42. };
  43.  
  44. /* Current Major version number */
  45.  
  46. enum {
  47.     cmCurrentProfileMajorVersion = 0x02000000
  48. };
  49.  
  50. /* magic cookie number for anonymous file ID */
  51.  
  52. enum {
  53.     cmMagicNumber                = 'acsp'
  54. };
  55.  
  56. /* ColorSync profile version 1.0 */
  57.  
  58. enum {
  59.     cmCS1ProfileVersion            = 0x00000100
  60. };
  61.  
  62. /************************************************************************/
  63. /*************** ColorSync 2.0 profile specification ********************/
  64. /************************************************************************/
  65. /**** flags field  ****/
  66.  
  67. enum {
  68.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  69.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  70.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  71.     cmCMSReservedFlagsMask        = 0xFFFF0000,                    /* these bits of the flags field are defined and reserved by CMS vendor */
  72.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  73.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  74.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  75. };
  76.  
  77. /* copyright-protection flag options */
  78.  
  79. enum {
  80.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  81.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  82. };
  83.  
  84. /* speed and quality flag options */
  85.  
  86. enum {
  87.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  88.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  89.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  90. };
  91.  
  92. /**** deviceAttributes fields ****/
  93.  
  94. enum {
  95.     cmICCReservedAttr0Mask        = 0x0000FFFF,                    /* these bits of the deviceAttributes[0] field are defined and reserved by ICC */
  96.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  97.     cmGlossyMatteMask            = 0x00000002,                    /* if bit 1 is 0 then glossy, if 1 then matte */
  98.     cmVendorReservedAttr0Mask    = 0xFFFF0000,                    /* these bits of the deviceAttributes[0] field are defined and reserved by device vendor */
  99.     cmVendorReservedAttr1Mask    = 0xFFFFFFFF                    /* these bits of the deviceAttributes[1] field are defined and reserved by device vendor */
  100. };
  101.  
  102. /* device/media attributes element values  */
  103.  
  104. enum {
  105.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  106.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  107. };
  108.  
  109. /**** renderingIntent field ****/
  110.  
  111. enum {
  112.     cmPerceptual                = 0,                            /* Photographic images */
  113.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  114.     cmSaturation                = 2,                            /* Business graphics */
  115.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  116. };
  117.  
  118. /* data type element values */
  119.  
  120. enum {
  121.     cmAsciiData                    = 0,
  122.     cmBinaryData                = 1
  123. };
  124.  
  125. /* screen encodings  */
  126.  
  127. enum {
  128.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  129.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  130. };
  131.  
  132. /* 2.0 tag type information */
  133.  
  134. enum {
  135.     cmNumHeaderElements            = 10
  136. };
  137.  
  138. /* public tags */
  139.  
  140. enum {
  141.     cmAToB0Tag                    = 'A2B0',
  142.     cmAToB1Tag                    = 'A2B1',
  143.     cmAToB2Tag                    = 'A2B2',
  144.     cmBlueColorantTag            = 'bXYZ',
  145.     cmBlueTRCTag                = 'bTRC',
  146.     cmBToA0Tag                    = 'B2A0',
  147.     cmBToA1Tag                    = 'B2A1',
  148.     cmBToA2Tag                    = 'B2A2',
  149.     cmCalibrationDateTimeTag    = 'calt',
  150.     cmCharTargetTag                = 'targ',
  151.     cmCopyrightTag                = 'cprt',
  152.     cmDeviceMfgDescTag            = 'dmnd',
  153.     cmDeviceModelDescTag        = 'dmdd',
  154.     cmGamutTag                    = 'gamt',
  155.     cmGrayTRCTag                = 'kTRC',
  156.     cmGreenColorantTag            = 'gXYZ',
  157.     cmGreenTRCTag                = 'gTRC',
  158.     cmLuminanceTag                = 'lumi',
  159.     cmMeasurementTag            = 'meas',
  160.     cmMediaBlackPointTag        = 'bkpt',
  161.     cmMediaWhitePointTag        = 'wtpt',
  162.     cmNamedColorTag                = 'ncol',
  163.     cmNamedColor2Tag            = 'ncl2',
  164.     cmPreview0Tag                = 'pre0',
  165.     cmPreview1Tag                = 'pre1',
  166.     cmPreview2Tag                = 'pre2',
  167.     cmProfileDescriptionTag        = 'desc',
  168.     cmProfileSequenceDescTag    = 'pseq',
  169.     cmPS2CRD0Tag                = 'psd0',
  170.     cmPS2CRD1Tag                = 'psd1',
  171.     cmPS2CRD2Tag                = 'psd2',
  172.     cmPS2CRD3Tag                = 'psd3',
  173.     cmPS2CSATag                    = 'ps2s',
  174.     cmPS2RenderingIntentTag        = 'ps2i',
  175.     cmRedColorantTag            = 'rXYZ',
  176.     cmRedTRCTag                    = 'rTRC',
  177.     cmScreeningDescTag            = 'scrd',
  178.     cmScreeningTag                = 'scrn',
  179.     cmTechnologyTag                = 'tech',
  180.     cmUcrBgTag                    = 'bfd ',
  181.     cmViewingConditionsDescTag    = 'vued',
  182.     cmViewingConditionsTag        = 'view'
  183. };
  184.  
  185. /* custom tags */
  186.  
  187. enum {
  188.     cmPS2CRDVMSizeTag            = 'psvm'
  189. };
  190.  
  191. /* technology tag descriptions */
  192.  
  193. enum {
  194.     cmTechnologyFilmScanner        = 'fscn',
  195.     cmTechnologyReflectiveScanner = 'rscn',
  196.     cmTechnologyInkJetPrinter    = 'ijet',
  197.     cmTechnologyThermalWaxPrinter = 'twax',
  198.     cmTechnologyElectrophotographicPrinter = 'epho',
  199.     cmTechnologyElectrostaticPrinter = 'esta',
  200.     cmTechnologyDyeSublimationPrinter = 'dsub',
  201.     cmTechnologyPhotographicPaperPrinter = 'rpho',
  202.     cmTechnologyFilmWriter        = 'fprn',
  203.     cmTechnologyVideoMonitor    = 'vidm',
  204.     cmTechnologyVideoCamera        = 'vidc',
  205.     cmTechnologyProjectionTelevision = 'pjtv',
  206.     cmTechnologyCRTDisplay        = 'CRT ',
  207.     cmTechnologyPMDisplay        = 'PMD ',
  208.     cmTechnologyAMDisplay        = 'AMD ',
  209.     cmTechnologyPhotoCD            = 'KPCD',
  210.     cmTechnologyPhotoImageSetter = 'imgs',
  211.     cmTechnologyGravure            = 'grav',
  212.     cmTechnologyOffsetLithography = 'offs',
  213.     cmTechnologySilkscreen        = 'silk',
  214.     cmTechnologyFlexography        = 'flex'
  215. };
  216.  
  217. /* type signatures */
  218.  
  219. enum {
  220.     cmSigCurveType                = 'curv',
  221.     cmSigDataType                = 'data',
  222.     cmSigDateTimeType            = 'dtim',
  223.     cmSigLut16Type                = 'mft2',
  224.     cmSigLut8Type                = 'mft1',
  225.     cmSigMeasurementType        = 'meas',
  226.     cmSigNamedColorType            = 'ncol',
  227.     cmSigNamedColor2Type        = 'ncl2',
  228.     cmSigProfileDescriptionType    = 'desc',
  229.     cmSigScreeningType            = 'scrn',
  230.     cmSigS15Fixed16Type            = 'sf32',
  231.     cmSigSignatureType            = 'sig ',
  232.     cmSigTextType                = 'text',
  233.     cmSigU16Fixed16Type            = 'uf32',
  234.     cmSigU1Fixed15Type            = 'uf16',
  235.     cmSigUInt32Type                = 'ui32',
  236.     cmSigUInt64Type                = 'ui64',
  237.     cmSigUInt8Type                = 'ui08',
  238.     cmSigViewingConditionsType    = 'view',
  239.     cmSigXYZType                = 'XYZ '
  240. };
  241.  
  242. /* Measurement type encodings */
  243. /* Measurement Flare */
  244.  
  245. enum {
  246.     cmFlare0                    = 0x00000000,
  247.     cmFlare100                    = 0x00000001
  248. };
  249.  
  250. /* Measurement Geometry    */
  251.  
  252. enum {
  253.     cmGeometryUnknown            = 0x00000000,
  254.     cmGeometry045or450            = 0x00000001,
  255.     cmGeometry0dord0            = 0x00000002
  256. };
  257.  
  258. /* Standard Observer    */
  259.  
  260. enum {
  261.     cmStdobsUnknown                = 0x00000000,
  262.     cmStdobs1931TwoDegrees        = 0x00000001,
  263.     cmStdobs1964TenDegrees        = 0x00000002
  264. };
  265.  
  266. /* Standard Illuminant */
  267.  
  268. enum {
  269.     cmIlluminantUnknown            = 0x00000000,
  270.     cmIlluminantD50                = 0x00000001,
  271.     cmIlluminantD65                = 0x00000002,
  272.     cmIlluminantD93                = 0x00000003,
  273.     cmIlluminantF2                = 0x00000004,
  274.     cmIlluminantD55                = 0x00000005,
  275.     cmIlluminantA                = 0x00000006,
  276.     cmIlluminantEquiPower        = 0x00000007,
  277.     cmIlluminantF8                = 0x00000008
  278. };
  279.  
  280. /* Spot Function Value */
  281.  
  282. enum {
  283.     cmSpotFunctionUnknown        = 0,
  284.     cmSpotFunctionDefault        = 1,
  285.     cmSpotFunctionRound            = 2,
  286.     cmSpotFunctionDiamond        = 3,
  287.     cmSpotFunctionEllipse        = 4,
  288.     cmSpotFunctionLine            = 5,
  289.     cmSpotFunctionSquare        = 6,
  290.     cmSpotFunctionCross            = 7
  291. };
  292.  
  293. /* Color Space Signatures */
  294.  
  295. enum {
  296.     cmXYZData                    = 'XYZ ',
  297.     cmLabData                    = 'Lab ',
  298.     cmLuvData                    = 'Luv ',
  299.     cmYxyData                    = 'Yxy ',
  300.     cmRGBData                    = 'RGB ',
  301.     cmGrayData                    = 'GRAY',
  302.     cmHSVData                    = 'HSV ',
  303.     cmHLSData                    = 'HLS ',
  304.     cmCMYKData                    = 'CMYK',
  305.     cmCMYData                    = 'CMY ',
  306.     cmMCH5Data                    = 'MCH5',
  307.     cmMCH6Data                    = 'MCH6',
  308.     cmMCH7Data                    = 'MCH7',
  309.     cmMCH8Data                    = 'MCH8'
  310. };
  311.  
  312. /* profileClass enumerations */
  313.  
  314. enum {
  315.     cmInputClass                = 'scnr',
  316.     cmDisplayClass                = 'mntr',
  317.     cmOutputClass                = 'prtr',
  318.     cmLinkClass                    = 'link',
  319.     cmAbstractClass                = 'abst',
  320.     cmColorSpaceClass            = 'spac',
  321.     cmNamedColorClass            = 'nmcl'
  322. };
  323.  
  324. /* platform enumerations */
  325.  
  326. enum {
  327.     cmMacintosh                    = 'APPL',
  328.     cmMicrosoft                    = 'MSFT',
  329.     cmSolaris                    = 'SUNW',
  330.     cmSiliconGraphics            = 'SGI ',
  331.     cmTaligent                    = 'TGNT'
  332. };
  333.  
  334. /* ColorSync 1.0 elements */
  335.  
  336. enum {
  337.     cmCS1ChromTag                = 'chrm',
  338.     cmCS1TRCTag                    = 'trc ',
  339.     cmCS1NameTag                = 'name',
  340.     cmCS1CustTag                = 'cust'
  341. };
  342.  
  343. /* General element data types */
  344. struct CMDateTime {
  345.     unsigned short                     year;
  346.     unsigned short                     month;
  347.     unsigned short                     dayOfTheMonth;
  348.     unsigned short                     hours;
  349.     unsigned short                     minutes;
  350.     unsigned short                     seconds;
  351. };
  352. typedef struct CMDateTime CMDateTime;
  353.  
  354. struct CMFixedXYZColor {
  355.     Fixed                             X;
  356.     Fixed                             Y;
  357.     Fixed                             Z;
  358. };
  359. typedef struct CMFixedXYZColor CMFixedXYZColor;
  360.  
  361. typedef unsigned short CMXYZComponent;
  362. struct CMXYZColor {
  363.     CMXYZComponent                     X;
  364.     CMXYZComponent                     Y;
  365.     CMXYZComponent                     Z;
  366. };
  367. typedef struct CMXYZColor CMXYZColor;
  368.  
  369. struct CM2Header {
  370.     unsigned long                     size;                        /* This is the total size of the Profile */
  371.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  372.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  373.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  374.     OSType                             dataColorSpace;                /* color space of data */
  375.     OSType                             profileConnectionSpace;        /* profile connection color space */
  376.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  377.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  378.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  379.     unsigned long                     flags;                        /* profile flags */
  380.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  381.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  382.     unsigned long                     deviceAttributes[2];        /* Attributes like paper type */
  383.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  384.     CMFixedXYZColor                 white;                        /* profile illuminant */
  385.     OSType                             creator;                    /* profile creator */
  386.     char                             reserved[44];                /* reserved for future use */
  387. };
  388. typedef struct CM2Header CM2Header;
  389.  
  390. struct CMTagRecord {
  391.     OSType                             tag;                        /* Registered with CS2 consortium */
  392.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  393.     unsigned long                     elementSize;
  394. };
  395. typedef struct CMTagRecord CMTagRecord;
  396.  
  397. struct CMTagElemTable {
  398.     unsigned long                     count;
  399.     CMTagRecord                     tagList[1];                    /* Variable size */
  400. };
  401. typedef struct CMTagElemTable CMTagElemTable;
  402.  
  403. /* External 0x02002001 CMProfile */
  404. struct CM2Profile {
  405.     CM2Header                         header;
  406.     CMTagElemTable                     tagTable;
  407.     char                             elemData[1];                /* Tagged element storage. Variable size */
  408. };
  409. typedef struct CM2Profile CM2Profile;
  410.  
  411. typedef CM2Profile *CM2ProfilePtr;
  412. typedef CM2ProfilePtr *CM2ProfileHandle;
  413. /* Tag Type Definitions */
  414. struct CMCurveType {
  415.     OSType                             typeDescriptor;                /* 'curv' */
  416.     unsigned long                     reserved;                    /* fill with 0x00 */
  417.     unsigned long                     countValue;                    /* number of entries in table that follows */
  418.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  419. };
  420. typedef struct CMCurveType CMCurveType;
  421.  
  422. struct CMDataType {
  423.     OSType                             typeDescriptor;                /* 'data' */
  424.     unsigned long                     reserved;                    /* fill with 0x00 */
  425.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  426.     char                             data[1];                    /* Tagged element storage. Variable size */
  427. };
  428. typedef struct CMDataType CMDataType;
  429.  
  430. struct CMDateTimeType {
  431.     OSType                             typeDescriptor;                /* 'dtim' */
  432.     unsigned long                     reserved;
  433.     CMDateTime                         dateTime;
  434. };
  435. typedef struct CMDateTimeType CMDateTimeType;
  436.  
  437. struct CMLut16Type {
  438.     OSType                             typeDescriptor;                /* 'mft2' */
  439.     unsigned long                     reserved;                    /* fill with 0x00 */
  440.     unsigned char                     inputChannels;                /* Number of input channels */
  441.     unsigned char                     outputChannels;                /* Number of output channels */
  442.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  443.     unsigned char                     reserved2;                    /* fill with 0x00 */
  444.     Fixed                             matrix[3][3];                /* */
  445.     unsigned short                     inputTableEntries;            /* */
  446.     unsigned short                     outputTableEntries;            /* */
  447.     unsigned short                     inputTable[1];                /* Variable size */
  448.     unsigned short                     CLUT[1];                    /* Variable size */
  449.     unsigned short                     outputTable[1];                /* Variable size */
  450. };
  451. typedef struct CMLut16Type CMLut16Type;
  452.  
  453. struct CMLut8Type {
  454.     OSType                             typeDescriptor;                /* 'mft1' */
  455.     unsigned long                     reserved;                    /* fill with 0x00 */
  456.     unsigned char                     inputChannels;                /* */
  457.     unsigned char                     outputChannels;                /* */
  458.     unsigned char                     gridPoints;                    /* */
  459.     unsigned char                     reserved2;                    /* fill with 0x00 */
  460.     Fixed                             matrix[3][3];                /* */
  461.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  462.     unsigned char                     CLUT[2];                    /* Variable size */
  463.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  464. };
  465. typedef struct CMLut8Type CMLut8Type;
  466.  
  467. struct CMMeasurementType {
  468.     OSType                             typeDescriptor;                /* 'meas' */
  469.     unsigned long                     reserved;                    /* fill with 0x00 */
  470.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  471.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  472.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  473.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  474.     unsigned long                     illuminant;                    /* standard illuminant */
  475. };
  476. typedef struct CMMeasurementType CMMeasurementType;
  477.  
  478. struct CMNamedColorType {
  479.     OSType                             typeDescriptor;                /* 'ncol' */
  480.     unsigned long                     reserved;                    /* fill with 0x00 */
  481.     unsigned long                     vendorFlag;                    /* */
  482.     unsigned long                     count;                        /* count of named colors in array that follows */
  483.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  484.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  485.     char                             data[1];                    /* varaible size data as explained below */
  486. };
  487. typedef struct CMNamedColorType CMNamedColorType;
  488.  
  489. /*
  490.     A variable size array of structs appears as the last block of data
  491.     in the above struct, CMNamedColorType.  The data structure
  492.     is as follows: (example in C)
  493.     
  494.      struct {                                             
  495.             unsigned char    rootName[1];                 * Variable size, max = 32 
  496.             unsigned char    colorCoords[1];                 * Variable size  
  497.      } colorName[1];                                     * Variable size  
  498. */
  499. struct CMNamedColor2Type {
  500.     OSType                             typeDescriptor;                /* 'ncl2' */
  501.     unsigned long                     reserved;                    /* fill with 0x00 */
  502.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  503.     unsigned long                     count;                        /* count of named colors in array that follows */
  504.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  505.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  506.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  507.     char                             data[1];                    /* varaible size data as explained below */
  508. };
  509. typedef struct CMNamedColor2Type CMNamedColor2Type;
  510.  
  511. /*
  512.     A variable size array of structs appears as the last block of data
  513.     in the above struct, CMNamedColor2Type.  The data structure
  514.     is as follows: (example in C)
  515.     
  516.      struct {                                             
  517.             unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  518.             unsigned char    PCSColorCoords[1];             * Variable size  
  519.             unsigned char    DeviceColorCoords[1];         * Variable size  
  520.      } colorName2[1];                                     * Variable size  
  521. */
  522. struct CMTextDescriptionType {
  523.     OSType                             typeDescriptor;                /* 'desc' */
  524.     unsigned long                     reserved;                    /* fill with 0x00 */
  525.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  526.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  527.     unsigned long                     UniCodeCode;
  528.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  529.     unsigned char                     UniCodeName[2];                /* Variable size */
  530.     short                             ScriptCodeCode;
  531.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  532.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  533. };
  534. typedef struct CMTextDescriptionType CMTextDescriptionType;
  535.  
  536. struct CMTextType {
  537.     OSType                             typeDescriptor;                /* 'text' */
  538.     unsigned long                     reserved;                    /* fill with 0x00 */
  539.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  540. };
  541. typedef struct CMTextType CMTextType;
  542.  
  543. struct CMScreeningType {
  544.     OSType                             typeDescriptor;                /* 'scrn' */
  545.     unsigned long                     reserved;                    /* fill with 0x00 */
  546.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  547.     unsigned long                     channelCount;
  548.     char                             data[1];                    /* varaible size data as explained below */
  549. };
  550. typedef struct CMScreeningType CMScreeningType;
  551.  
  552. /*
  553.     A variable size array of structs appears as the last block of data
  554.     in the above struct, CMScreeningType.  The data structure
  555.     is as follows: (example in C)
  556.     
  557.     struct {
  558.         Fixed            frequency;
  559.         Fixed            angle;
  560.         unsigned long    sportFunction;
  561.      }    channelScreening[1];                             * Variable size 
  562. */
  563. struct CMSignatureType {
  564.     OSType                             typeDescriptor;                /* 'sig ' */
  565.     unsigned long                     reserved;                    /* fill with 0x00 */
  566.     OSType                             signature;
  567. };
  568. typedef struct CMSignatureType CMSignatureType;
  569.  
  570. struct CMS15Fixed16ArrayType {
  571.     OSType                             typeDescriptor;                /* 'sf32' */
  572.     unsigned long                     reserved;                    /* fill with 0x00 */
  573.     Fixed                             value[1];                    /* Variable size */
  574. };
  575. typedef struct CMS15Fixed16ArrayType CMS15Fixed16ArrayType;
  576.  
  577. struct CMU16Fixed16ArrayType {
  578.     OSType                             typeDescriptor;                /* 'uf32' */
  579.     unsigned long                     reserved;                    /* fill with 0x00 */
  580.     unsigned long                     value[1];                    /* Variable size */
  581. };
  582. typedef struct CMU16Fixed16ArrayType CMU16Fixed16ArrayType;
  583.  
  584. struct CMUInt16ArrayType {
  585.     OSType                             typeDescriptor;                /* 'ui16' */
  586.     unsigned long                     reserved;                    /* fill with 0x00 */
  587.     unsigned short                     value[1];                    /* Variable size */
  588. };
  589. typedef struct CMUInt16ArrayType CMUInt16ArrayType;
  590.  
  591. struct CMUInt32ArrayType {
  592.     OSType                             typeDescriptor;                /* 'ui32' */
  593.     unsigned long                     reserved;                    /* fill with 0x00 */
  594.     unsigned long                     value[1];                    /* Variable size */
  595. };
  596. typedef struct CMUInt32ArrayType CMUInt32ArrayType;
  597.  
  598. struct CMUInt64ArrayType {
  599.     OSType                             typeDescriptor;                /* 'ui64' */
  600.     unsigned long                     reserved;                    /* fill with 0x00 */
  601.     unsigned long                     value[1];                    /* Variable size (x2) */
  602. };
  603. typedef struct CMUInt64ArrayType CMUInt64ArrayType;
  604.  
  605. struct CMUInt8ArrayType {
  606.     OSType                             typeDescriptor;                /* 'ui08' */
  607.     unsigned long                     reserved;                    /* fill with 0x00 */
  608.     unsigned char                     value[1];                    /* Variable size */
  609. };
  610. typedef struct CMUInt8ArrayType CMUInt8ArrayType;
  611.  
  612. struct CMViewingConditionsType {
  613.     OSType                             typeDescriptor;                /* 'view' */
  614.     unsigned long                     reserved;                    /* fill with 0x00 */
  615.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  616.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  617.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  618. };
  619. typedef struct CMViewingConditionsType CMViewingConditionsType;
  620.  
  621. struct CMXYZType {
  622.     OSType                             typeDescriptor;                /* 'XYZ ' */
  623.     unsigned long                     reserved;                    /* fill with 0x00 */
  624.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  625. };
  626. typedef struct CMXYZType CMXYZType;
  627.  
  628. /* Profile sequence description type */
  629. struct CMProfileSequenceDescType {
  630.     OSType                             typeDescriptor;                /* 'pseq ' */
  631.     unsigned long                     reserved;                    /* fill with 0x00 */
  632.     unsigned long                     count;                        /* Number of descriptions */
  633.     char                             data[1];                    /* varaible size data as explained below */
  634. };
  635. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  636.  
  637. /*
  638.     A variable size array of structs appears as the last block of data
  639.     in the above struct, CMProfileSequenceDescType.  The data structure
  640.     is as follows: (example in C)
  641.     
  642.      struct {                                             
  643.             OSType            deviceMfg;                     * Device Manufacturer 
  644.             OSType            deviceModel;                 * Decvice Model 
  645.             unsigned long    attributes[2];                 * Device attributes 
  646.             OSType            technology;                     * Technology signature 
  647.             unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  648.             unsigned char    mfgDescASCIIName[2];         * Variable size 
  649.             unsigned long    mfgDescUniCodeCode;             
  650.             unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  651.             unsigned char    mfgDescUniCodeName[2];         * Variable size 
  652.             unsigned long    mfgDescScriptCodeCode;         
  653.             unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  654.             unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  655.             unsigned long    modelDescASCIICount;         * the count of "bytes" 
  656.             unsigned char    modelDescASCIIName[2];         * Variable size 
  657.             unsigned long    modelDescUniCodeCode;         
  658.             unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  659.             unsigned char    modelDescUniCodeName[2];     * Variable size 
  660.             short            modelDescScriptCodeCode;     
  661.             unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  662.             SInt8            filler;                         * For proper alignment across languages 
  663.             unsigned char    modelDescScriptCodeName[2];     * Variable size 
  664.      }    profileDescription[1];                         
  665. */
  666. /* Under color removal, black generation type */
  667. struct CMUcrBgType {
  668.     OSType                             typeDescriptor;                /* 'bfd  ' */
  669.     unsigned long                     reserved;                    /* fill with 0x00 */
  670.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  671.     unsigned short                     ucrValues[1];                /* variable size */
  672.     unsigned long                     bgCount;                    /* Number of BG entries */
  673.     unsigned short                     bgValues[1];                /* variable size */
  674.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  675. };
  676. typedef struct CMUcrBgType CMUcrBgType;
  677.  
  678. struct CMIntentCRDVMSize {
  679.     long                             renderingIntent;            /* rendering intent */
  680.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  681. };
  682. typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
  683.  
  684. struct CMPS2CRDVMSizeType {
  685.     OSType                             typeDescriptor;                /* 'psvm' */
  686.     unsigned long                     reserved;                    /* fill with 0x00 */
  687.     unsigned long                     count;                        /* number of intent entries */
  688.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  689. };
  690. typedef struct CMPS2CRDVMSizeType CMPS2CRDVMSizeType;
  691.  
  692. /************************************************************************/
  693. /*************** ColorSync 1.0 profile specification ********************/
  694. /************************************************************************/
  695.  
  696. enum {
  697.     cmGrayResponse                = 0,
  698.     cmRedResponse                = 1,
  699.     cmGreenResponse                = 2,
  700.     cmBlueResponse                = 3,
  701.     cmCyanResponse                = 4,
  702.     cmMagentaResponse            = 5,
  703.     cmYellowResponse            = 6,
  704.     cmUcrResponse                = 7,
  705.     cmBgResponse                = 8,
  706.     cmOnePlusLastResponse        = 9
  707. };
  708.  
  709. /* Device types */
  710.  
  711. enum {
  712.     cmMonitorDevice                = 'mntr',
  713.     cmScannerDevice                = 'scnr',
  714.     cmPrinterDevice                = 'prtr'
  715. };
  716.  
  717. struct CMIString {
  718.     ScriptCode                         theScript;
  719.     Str63                             theString;
  720. };
  721. typedef struct CMIString CMIString;
  722.  
  723. /* Profile options */
  724.  
  725. enum {
  726.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  727.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  728.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  729. };
  730.  
  731. /* Profile flags */
  732.  
  733. enum {
  734.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  735.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  736. };
  737.  
  738. typedef long CMMatchOption;
  739. typedef long CMMatchFlag;
  740. struct CMHeader {
  741.     unsigned long                     size;
  742.     OSType                             CMMType;
  743.     unsigned long                     applProfileVersion;
  744.     OSType                             dataType;
  745.     OSType                             deviceType;
  746.     OSType                             deviceManufacturer;
  747.     unsigned long                     deviceModel;
  748.     unsigned long                     deviceAttributes[2];
  749.     unsigned long                     profileNameOffset;
  750.     unsigned long                     customDataOffset;
  751.     CMMatchFlag                     flags;
  752.     CMMatchOption                     options;
  753.     CMXYZColor                         white;
  754.     CMXYZColor                         black;
  755. };
  756. typedef struct CMHeader CMHeader;
  757.  
  758. struct CMProfileChromaticities {
  759.     CMXYZColor                         red;
  760.     CMXYZColor                         green;
  761.     CMXYZColor                         blue;
  762.     CMXYZColor                         cyan;
  763.     CMXYZColor                         magenta;
  764.     CMXYZColor                         yellow;
  765. };
  766. typedef struct CMProfileChromaticities CMProfileChromaticities;
  767.  
  768. struct CMProfileResponse {
  769.     unsigned short                     counts[9];
  770.     unsigned short                     data[1];                    /* Variable size */
  771. };
  772. typedef struct CMProfileResponse CMProfileResponse;
  773.  
  774. struct CMProfile {
  775.     CMHeader                         header;
  776.     CMProfileChromaticities         profile;
  777.     CMProfileResponse                 response;
  778.     CMIString                         profileName;
  779.     char                             customData[1];                /* Variable size */
  780. };
  781. typedef struct CMProfile CMProfile;
  782.  
  783. typedef CMProfile *CMProfilePtr;
  784. typedef CMProfilePtr *CMProfileHandle;
  785. #if OLDROUTINENAMES
  786.  
  787. enum {
  788.     kCMApplProfileVersion        = cmCS1ProfileVersion
  789. };
  790.  
  791.  
  792. enum {
  793.     grayResponse                = cmGrayResponse,
  794.     redResponse                    = cmRedResponse,
  795.     greenResponse                = cmGreenResponse,
  796.     blueResponse                = cmBlueResponse,
  797.     cyanResponse                = cmCyanResponse,
  798.     magentaResponse                = cmMagentaResponse,
  799.     yellowResponse                = cmYellowResponse,
  800.     ucrResponse                    = cmUcrResponse,
  801.     bgResponse                    = cmBgResponse,
  802.     onePlusLastResponse            = cmOnePlusLastResponse
  803. };
  804.  
  805.  
  806. enum {
  807.     rgbData                        = cmRGBData,
  808.     cmykData                    = cmCMYKData,
  809.     grayData                    = cmGrayData,
  810.     xyzData                        = cmXYZData
  811. };
  812.  
  813.  
  814. enum {
  815.     XYZData                        = cmXYZData
  816. };
  817.  
  818.  
  819. enum {
  820.     monitorDevice                = cmMonitorDevice,
  821.     scannerDevice                = cmScannerDevice,
  822.     printerDevice                = cmPrinterDevice
  823. };
  824.  
  825.  
  826. enum {
  827.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  828.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  829. };
  830.  
  831.  
  832. enum {
  833.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  834.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  835.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  836. };
  837.  
  838. typedef unsigned short XYZComponent;
  839. typedef CMXYZColor XYZColor;
  840. typedef unsigned short CMResponseData;
  841. typedef CMIString IString;
  842. typedef long CMResponseColor;
  843. typedef CMResponseColor responseColor;
  844. #endif
  845.  
  846. #if PRAGMA_ALIGN_SUPPORTED
  847. #pragma options align=reset
  848. #endif
  849.  
  850. #if PRAGMA_IMPORT_SUPPORTED
  851. #pragma import off
  852. #endif
  853.  
  854. #ifdef __cplusplus
  855. }
  856. #endif
  857.  
  858. #endif /* __CMICCPROFILE__ */
  859.  
  860.